Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relax some over-constrained impl bounds #296

Merged
merged 1 commit into from
Jan 16, 2024
Merged

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Jan 16, 2024

Most of these are removing K: Hash + Eq and/or S: BuildHasher where
we don't actually need to hash anything.

In some cases, we only get away with that because we have a saved hash
in each entry Bucket. I suspect we still kept the constraints as API
protection, in case we ever wanted to change our mind and stop saving
the hash. However, there are a few other unconstrained methods that also
need the saved hash, like swap_remove_index going back long before
version 1.0 of the crate, so that ship has sailed.

Most of these are removing `K: Hash + Eq` and/or `S: BuildHasher` where
we don't actually need to hash anything.

In some cases, we only get away with that because we have a saved hash
in each entry `Bucket`. I *suspect* we still kept the constraints as API
protection, in case we ever wanted to change our mind and stop saving
the hash. However, there are a few other unconstrained methods that also
need the saved hash, like `swap_remove_index` going back long before
version 1.0 of the crate, so that ship has sailed.
@cuviper
Copy link
Member Author

cuviper commented Jan 16, 2024

However, there are a few other unconstrained methods that also
need the saved hash, like swap_remove_index going back long before
version 1.0 of the crate, so that ship has sailed.

Reference: commit 67a04b2

@cuviper cuviper merged commit f7cf609 into indexmap-rs:master Jan 16, 2024
14 checks passed
@cuviper cuviper deleted the relax branch January 17, 2024 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant